#include "scripting/extra/info_api.hpp"
#include "app/app_base.hpp"
#include "utils/macros.h"

u64 GetAppVersionCode()
{
    static u64 code_cache = 0;
    if (code_cache == 0) {
        code_cache = App->AppVersion().code();
    }
    return code_cache;
}

const char * GetAppVersionText()
{
    static char text_cache[64];
    if (!text_cache[0]) {
        std::string text = App->AppVersion().str();
        strcpy(text_cache, text.c_str());
    }
    return text_cache;
}

const char * GetAppVersionInfo()
{
    static char text_cache[64];
    if (!text_cache[0]) {
        std::string text = App->AppVersion().info();
        strcpy(text_cache, text.c_str());
    }
    return text_cache;
}

const char * GetDataVersion()
{
    return 
    STRINGFY(DATA_VERSION_MAJOR) "."
    STRINGFY(DATA_VERSION_MINOR) "."
    STRINGFY(DATA_VERSION_REVISION);
}

u32 GetDataVersionCode()
{
    return DATA_VERSION;
}
